import { findTypeByValue, findTypeByLabel } from '@/utils/findType'
import * as types from "./types"

// 渠道Table
export const configTableFrame = [
  { 
    prop: "num", 
    label: "序号", 
    minWidth: "50px", 
    tooltip: true 
  },
  { 
    prop: "name", 
    label: "项目名称", 
    minWidth: "120px",
    formatter: (row) => {
      return row.name;
    }
  },
  { 
    prop: "companyList", 
    label: "药企",
    minWidth: "80px",
    formatter: (row) => {
      return row?.companyList?.map(item => item.name).join(",");
    }
  },
  { 
    prop: "taskNum", 
    label: "任务总数",
    minWidth: "40px",
    formatter: (row) => {
      return row?.taskNum
    }
  },
  { 
    prop: "taskNum", 
    label: "任务数",
    minWidth: "40px",
    formatter: (row) => {
      return row?.taskNum
    }
  },
  { 
    prop: "answerNum", 
    label: "问答数",
    minWidth: "40px",
    formatter: (row) => {
      return row?.answerNum
    }
  },
  { 
    prop: "explainNum", 
    label: "解读数",
    minWidth: "40px",
    formatter: (row) => {
      return row?.explainNum
    }
  },
  { 
    prop: "caseNum", 
    label: "案例数",
    minWidth: "40px",
    formatter: (row) => {
      return row?.caseNum
    }
  },
  { 
    prop: "doctorNum", 
    label: "医生数",
    minWidth: "40px",
    formatter: (row) => {
      return row?.doctorNum
    }
  },
  { 
    label: "操作", 
    slotName: "operate", 
    fixed: "right",
    minWidth: "80px"
  },
];

export const configProjectTableFrame = [
  { 
    prop: "num", 
    label: "序号", 
    minWidth: "30px", 
    tooltip: true 
  },
  { 
    prop: "name", 
    label: "姓名", 
    minWidth: "40px",
    formatter: (row) => {
      return row.name;
    }
  },
  { 
    prop: "hospital", 
    label: "医院",
    minWidth: "40px",
    formatter: (row) => {
      return row?.hospital
    }
  },
  { 
    prop: "mobile", 
    label: "手机",
    minWidth: "40px",
    formatter: (row) => {
      return row?.mobile
    }
  },
  { 
    prop: "taskNum", 
    label: "任务数",
    minWidth: "40px",
    formatter: (row) => {
      return row?.answerNum
    }
  },
  { 
    prop: "completeNum", 
    label: "完成数",
    minWidth: "40px",
    formatter: (row) => {
      return row?.completeNum
    }
  },
  { 
    prop: "diffRate", 
    label: "完成率",
    minWidth: "40px",
    formatter: (row) => {
      return row?.diffRate + '%'
    }
  }
];


export const searchFrame = [
  { 
    label: "项目名", 
    key: "name", 
    type: 1
  }
]
